package com.yunxi.service.dubboService.impl;

import com.github.pagehelper.PageInfo;
import com.yunxi.model.order.TrRefund;
import com.yunxi.order.pojo.TrRefundVO;
import com.yunxi.order.service.TrRefundDubboService;
import com.yunxi.service.localService.TrRefundService;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;

import java.lang.reflect.InvocationTargetException;
import java.util.List;

/**
 * <p>
 * 订单退款表 服务实现类
 * </p>
 *
 * @author 
 * @since 2019-09-09
 */
public class TrRefundDubboServiceImpl implements TrRefundDubboService {

    @Autowired
    @Qualifier(value = "trRefundServiceImpl")
    TrRefundService trRefundService;


    @Override
    public TrRefundVO getById(String id) throws InvocationTargetException, IllegalAccessException {
    TrRefund trRefund = trRefundService.getById(id);
    TrRefundVO trRefundVO = new TrRefundVO();
        BeanUtils.copyProperties(trRefund,trRefundVO);
        return trRefundVO;
    }

    @Override
    public void saveOrUpdate(TrRefundVO trRefundVO) throws InvocationTargetException, IllegalAccessException {
    TrRefund trRefund = new TrRefund();
        BeanUtils.copyProperties(trRefundVO,trRefund);
    trRefundService.saveOrUpdate(trRefund);
    }

    @Override
    public void removeById(String id) {
    trRefundService.removeById(id);
    }

    @Override
    public PageInfo<TrRefundVO> findPageByVO(TrRefundVO trRefundVO, Integer pageNum, Integer pageSize) throws InvocationTargetException, IllegalAccessException {
      PageInfo<TrRefundVO> pageInfo = trRefundService.pageByVo(trRefundVO,pageNum,pageSize);
      return pageInfo;
   }

    @Override
    public void removeByListVo(List<TrRefundVO> trRefundVOList) throws IllegalAccessException, InvocationTargetException, InstantiationException {
        trRefundService.removeByListVo(trRefundVOList);
    }

    @Override
    public List listByVo(TrRefundVO trRefundVO) {
      return trRefundService.listByVo(trRefundVO);
    }
}
